<?php include template('header','common');?>
<link rel="stylesheet" type="text/css" href="{__ROOT__}template/default/statics/css/join-tuoban.css?v={HD_VERSION}">

<div class="container">
	<div class="content">
		<div class="item">
			<div class="top">
				<img src="{$initiate['school_logo']}" alt="">
				<div class="top-content">
					<span>{$initiate['school_name']}午托班</span>
					<span>时间:00:00——24:00</span>
				</div>
				<span class="top-price"></span>
			</div>
			<div class="bottom">
				<span class="bottom-title">
					已加入的家长
					<i>({$count}/{$initiate['number']})</i>
				</span>
				<div class="bottom-img">
					<?php foreach($orders as $k => $v){?>
					<div>
						<img src="{$v['avatar']}" alt="">
					</div>
					<?php }?>
				</div>
			</div>
			<img class="sign" src="{__ROOT__}template/default/statics/img/faqi.png" alt="">
		</div>
	</div>
	<div class="btn-view">
		{if $order['student_id'] != $_GET['sid'] || $initiate['mid'] != $mid}
		<button class="btn2 faqiBtn" iid="{$initiate['id']}">加入</button>
		{/if}
		<button class="btn1" onclick="_system._guide(true)">分享邀请</button>
	</div> 
</div>

<style type="text/css">
#mess_share{margin:15px 0;}
#share_1{float:left;width:49%;}
#share_2{float:right;width:49%;}
#mess_share img{width:22px;height:22px;}
#cover{display:none;position:absolute;left:0;top:0;z-index:18888;background-color:#000000;opacity:0.7;}
#guide{display:none;position:absolute;right:18px;top:5px;z-index:19999;}
#guide img{width:260px;height:180px;}
</style>
<script type="text/javascript">
	$(".faqiBtn").click(function(){
		var iid = $(this).attr('iid');
		var ajaxurl="<?php echo url('member/index/initiate')?>"+"&iid="+iid;		
		window.location.href=ajaxurl;
	});
</script>

<?php include template('footer','common');?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
  wx.config({
        debug: false,
        appId: '<?php echo $signPackage["appId"];?>',
        timestamp: <?php echo $signPackage["timestamp"];?> ,
        noncestr: '<?php echo $signPackage["nonceStr"];?>',
        signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage'
        ]
    });
    wx.ready(function () {
        wx.checkJsApi({
            jsApiList: ['onMenuShareTimeline'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
            success: function (res) {
                // 以键值对的形式返回，可用的api值true，不可用为false
                // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
            }
        });
        wx.onMenuShareTimeline({
            title: '{$title}', // 分享标题
            link: "https://www.buytobuyer.com/api/api.order.share.php?sub_sn={$detail[sub_sn]}", // 分享链接
            imgUrl: '{$images}', //分享图标
            success: function () {
            },
            cancel: function () {
            }
        });
        wx.onMenuShareAppMessage({
            title: '{$title}', // 分享标题
            desc: '{$title},订单号：{$detail[sub_sn]}', // 分享描述
            link: "https://www.buytobuyer.com/api/api.order.share.php?sub_sn={$detail[sub_sn]}", // 分享链接
            imgUrl: '{$images}', //分享图标
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });
    });
</script>